package com.beehoo.dcportal.service.impl;

import com.beehoo.dcportal.common.base.BaseException;
import com.beehoo.dcportal.dao.IMessageDao;
import com.beehoo.dcportal.dao.IMessageDao.CoverType;
import com.beehoo.dcportal.dao.IMessageDao.MsgStatus;
import com.beehoo.dcportal.model.MessageBean;
import com.beehoo.dcportal.service.IMessageServ;
import java.util.List;

public class MessageServImpl
  implements IMessageServ
{
  private IMessageDao msgDao;

  public IMessageDao getMsgDao()
  {
    return this.msgDao;
  }

  public void setMsgDao(IMessageDao msgDao) {
    this.msgDao = msgDao;
  }

  public List<MessageBean> getTextMessageList(String streetId, String msgType, int pageRows)
    throws BaseException
  {
    return getTextMessageList(streetId, msgType, 1, pageRows);
  }

  public List<MessageBean> getTextMessageList(String streetId, String msgType, int pageNo, int pageRows)
    throws BaseException
  {
    return this.msgDao.getMessageList(streetId, msgType, IMessageDao.MsgStatus.PUBLISHED, IMessageDao.CoverType.ALL, pageNo, pageRows);
  }

  public List<MessageBean> getPortletTextMessageList(String streetId, String msgType, int pageRows)
    throws BaseException
  {
    return getPortletTextMessageList(streetId, msgType, 1, pageRows);
  }

  public List<MessageBean> getPortletTextMessageList(String streetId, String msgType, int pageNo, int pageRows)
    throws BaseException
  {
    return this.msgDao.getPortletMessageList(streetId, msgType, IMessageDao.MsgStatus.PUBLISHED, IMessageDao.CoverType.ALL, pageNo, pageRows);
  }

  public int getTextMessageCount(String streetId, String msgType)
    throws BaseException
  {
    return this.msgDao.getMessageCount(streetId, msgType, IMessageDao.MsgStatus.PUBLISHED, IMessageDao.CoverType.ALL);
  }

  public List<MessageBean> getPicMessageList(String streetId, String msgType, int pageRows)
    throws BaseException
  {
    return getPicMessageList(streetId, msgType, 1, pageRows);
  }

  public List<MessageBean> getPicMessageList(String streetId, String msgType, int pageNo, int pageRows)
    throws BaseException
  {
    return this.msgDao.getMessageList(streetId, msgType, IMessageDao.MsgStatus.PUBLISHED, IMessageDao.CoverType.ALL, pageNo, pageRows);
  }

  public int getPicMessageCount(String streetId, String msgType)
    throws BaseException
  {
    return this.msgDao.getMessageCount(streetId, msgType, IMessageDao.MsgStatus.PUBLISHED, IMessageDao.CoverType.ALL);
  }

  public List<MessageBean> getMessageList(String streetId, String msgType, int pageRows)
    throws BaseException
  {
    return getMessageList(streetId, msgType, 1, pageRows);
  }

  public List<MessageBean> getMessageList(String streetId, String msgType, int pageNo, int pageRows)
    throws BaseException
  {
    return this.msgDao.getMessageList(streetId, msgType, IMessageDao.MsgStatus.PUBLISHED, IMessageDao.CoverType.ALL, pageNo, pageRows);
  }

  public int getMessageCount(String streetId, String msgType)
    throws BaseException
  {
    return this.msgDao.getMessageCount(streetId, msgType, IMessageDao.MsgStatus.PUBLISHED, IMessageDao.CoverType.ALL);
  }

  public MessageBean getMessageItem(String streetId, String msgId)
    throws BaseException
  {
    return this.msgDao.getMessageItem(streetId, msgId);
  }
}